package jmine.tec.security.ldap;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum SecurityLDAPMessages implements MessageCreator {
    NENHUM_GRUPO_LDAP(0, "security-ldap.nenhum.grupo.ldap"),

    USUARIO_OU_SENHA_NAO_FORNECIDOS(0, "security-ldap.usuario.ou.senha.nao.fornecidos"),

    USUARIO_NAO_ENCONTRADO(1, "security-ldap.usuario.nao.encontrado"),

    ERRO_AUTENTICACAO(0, "security-ldap.erro.autenticacao"),

    NENHUMA_PERMISSAO(1, "security-ldap.nenhuma.permissao"),

    SENHA_INCORRETA(0, "security-ldap.senha.incorreta"),

    LDAP_INDISPONIVEL(0, "security-ldap.ldap.indisponivel"),

    NENHUMA_CREDENCIAL(1, "security-ldap.nenhuma.credencial");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private SecurityLDAPMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("security-ldap-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
